xl: fix compiler warnings
authorAndre Przywara <andre.przywara@amd.com>
Mon, 12 Dec 2011 17:43:15 +0000 (17:43 +0000)
committerAndre Przywara <andre.przywara@amd.com>
Mon, 12 Dec 2011 17:43:15 +0000 (17:43 +0000)
either GCC 4.6.1 or Ubuntu add -Werror=format-security to the -Wall set,
so libxl compilation breaks:
   libxl_create.c: In function 'store_libxl_entry':
   libxl_create.c:454:9: error: format not a string literal and no
format arguments [-Werror=format-security]
   cc1: all warnings being treated as errors

Attached patch fixes this and another occurrence.

Patch from: Uwe Dannowski

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c
tools/libxl/libxl_device.c

index ce6a55e959770e01d9ce5fa233a62e4c02feeb96..648615600c1e98ee82489821416398ca8a4b4d07 100644 (file)
@@ -461,7 +461,7 @@ static int store_libxl_entry(libxl__gc *gc, uint32_t domid,
 
     path = libxl__xs_libxl_path(gc, domid);
     path = libxl__sprintf(gc, "%s/dm-version", path);
-    return libxl__xs_write(gc, XBT_NULL, path, libxl__strdup(gc,
+    return libxl__xs_write(gc, XBT_NULL, path, "%s", libxl__strdup(gc,
         libxl_device_model_version_to_string(dm_info->device_model_version)));
 }
 
index a53fb708377d554bf0fb065aeb94ff78c31a5b8a..1db395c116b25d7c5115e034c338a40f8a6a66d6 100644 (file)
@@ -516,7 +516,7 @@ int libxl__devices_destroy(libxl__gc *gc, uint32_t domid, int force)
         for (j = 0; j < num_devs; j++) {
             path = libxl__sprintf(gc, "/local/domain/%d/device/%s/%s/backend",
                                   domid, kinds[i], devs[j]);
-            path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, path));
+            path = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc, "%s", path));
             if (path && libxl__parse_backend_path(gc, path, &dev) == 0) {
                 dev.domid = domid;
                 dev.kind = kind;